import { defineStore } from "pinia"

let useTodoStore = defineStore("todomvc", {
  state: () => {
    return {
      todoList: [
        {
          id: 1,
          text: "学习vue3",
          done: true,
          isEdit: false
        },
        {
          id: 2,
          text: "学习ts",
          done: false,
          isEdit: false
        }
      ]
    }
  },
  actions: {
    del(index: number) {
      this.todoList.splice(index, 1)
    }
  }
})

export default useTodoStore

